The present invention relates to recording and playing of sound data, and particularly to a recording and playing technique that reduces a processing load at the time of playing back sound data having a loop part.
In an information processing apparatus having a digital sound data playing function, such as a personal computer, a game machine, a music playing apparatus or the like, coded sound data are converted into analog sound data before sound output at the time of playing.
Some coded sound data, such as data of a music CD, are non-compressed. However, in many cases, sound data are read in a compressed state, and at the time of playing, expanded and outputted as sound.
Various sound compression methods have been proposed and practically used. Widely known is a method in which time series sample data are divided into a plurality of blocks, and an orthogonal transform such as DCT (Discrete Cosine Transform) or MDCT (Modified Discrete Cosine Transform) is applied to those blocks to obtain compressed data. In that case, to increase continuity of sound waveforms, compression is sequentially performed in groups of adjacent blocks, while making each group overlap with the next one in a block. As a representative of such compression methods, may be mentioned ATRAC (Adaptive TRans form Acoustic Coding) employed by a so-called mini disc (MD) and the like (See Patent Document 1).
FIG. 3 is a diagram showing compression of sound data in blocks. In the figure, time series sample data are divided into blocks (original blocks) A, B, C, D, E, . . . , each consisting of predetermined pieces of data.
Then, compression is performed in groups of two consecutive blocks, with each group overlapping the next group in one block, to generate encoded blocks. Here, no sound data exists before the start position (DS) of the sound data, and accordingly, there is no block to be paired with the block A. Thus, a block A0 consisting of dummy data such as silence data is added to be paired with the block A.
Then, in this example, encoded data X1 are generated from the original blocks A0 and A, and encoded data X2 from the original blocks A and B.
At the time of playing the sound data, a decoded block a is generated from the encoded blocks X1 and X2. Then, the samples of the decoded block a are subjected to D/A conversion to reproduce the sound. In the same way, decoded blocks b, c, . . . can be obtained, and thus, the sound is reproduced continuously. Here, FIG. 3(d) shows the decoded blocks in the case where audio codec delay occurs at the time of encoding and decoding. As shown in the figure, output positions of the decoded data are shifted by the size of the audio codec delay.
Patent Document 1: Japanese Non-examined Patent Laid-Open No. 8-287612
Sometimes, sound data include a loop part (a repeat part). For example, as shown in FIG. 3(a), there is a case where sound ranging from a prescribed position (LS) to another prescribed position (LE) of sample data is repeated until a certain condition is satisfied. Here, it is assumed that the start position LS of the loop is included in the original block A and the end position LE of the loop is included in the original block D.
At the time of playing in that case, as shown in FIG. 4, when playing is performed down to the position corresponding to LE in the decoded block d, then, playing is performed from the position corresponding to LS in the decoded block a.
Here, FIG. 4 shows the decoded blocks in the case where audio codec delay occurs at the time of encoding and decoding. As shown in the figure, output positions are shifted backward by the size of the audio codec delay. Namely, the loop start position and the loop end position are shifted backward by the size of the audio codec delay in comparison with the case where the audio codec delay does not exist.
The decoded block d is generated from the encoded blocks X4 and X5. Since the encoded block X4 has been already read for generating the decoded block c, it is sufficient to read X5 only. On the other hand, the decoded block a is generated from the encoded blocks X1 and X2. At the time of returning from the loop end, both the blocks X1 and X2 are read and processed.
At the time of looping, the decoded block a, which is played back immediately after the decoded block d, should have been generated until the playing of the decoded block d is ended. However, the whole of the decoded block d is not played back, but the decoded block d is played back only up to the position of LE. Thus, the decoded block a should be generated in a short time, and the processing load becomes large temporally.
This increase of the processing load at looping is a big problem for a sound data playing apparatus, such as a portable game machine, a portable music player, or the like, for which portability is important even if its processing speed is restricted.
An object of the present invention is to reduce a processing load at the time of playing back sound data including a loop part.